#include <func.h>

void* shijian(void* p)
{
    time_t t;
    time(&t);
    char buf[128];
    ctime_r(&t,buf);
    printf("now time1 is %ld,ctime1 is %s",t,buf);
    sleep(3);
    printf("now time2 is %ld,ctime2 is %s",t,buf);
    pthread_exit(NULL);
}

int main()
{
    pthread_t pth;
    int ret=pthread_create(&pth,NULL,shijian,NULL);
    sleep(1);
    time_t t;
    time(&t);
    char buf[128];
    ctime_r(&t,buf);
    printf("now main time is %ld,ctime is %s",t,buf);
    pthread_join(pth,NULL);
    return 0;
}